/**
 * 
 */
package ch.unisi.inf.gui;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.util.ArrayList;

import javax.swing.JFrame;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JSplitPane;

import bejar.MyCellRenderder;

/**
 * @author canova
 *
 */
public class ListPanel extends JList {
	
	private String[] list;
	
	public ListPanel(){
		
		
		
	}
	
	//public void setCell(){
		
	//	this.setCellRenderer(new ListRenderer());
	//}
	
	
	
	public static void main(String [] args){
		
		ArrayList<String> li = new ArrayList<String>();
		li.add("Library");
		li.add("Dogs");
		li.add("Cats");
		li.add("Cars");
		
		JFrame f = new JFrame();
		f.setLayout(new BorderLayout());
		f.setSize(new Dimension(400,400));
		
		Object[] yeah = li.toArray();
		
		ListPanel lista = new ListPanel();
		lista.setCellRenderer(new MyCellRenderder());
		JPanel photoPanel = new JPanel();
		
		for (int i = 0; i < li.size(); i++) {
			System.out.println(i);
			
		}
		
		JScrollPane s = new JScrollPane(lista);
		JScrollPane x = new JScrollPane(photoPanel);
		
		JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, s, x);
		split.setOneTouchExpandable(true);
		split.setDividerLocation(200);
		
		
		
		f.getContentPane().add(BorderLayout.CENTER, split);
		
		f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		f.setVisible(true);
		
	}
	
	

}
